#include <cstring>
#include <dirent.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/user.h>
#include <sys/wait.h>
#include <unistd.h>
using namespace std;

int main() {
  const char *astold = "/home/song/Desktop/graph/AST.txt";

  std::ifstream fin(astold);
  std::string line;
  std::string astcontent = "";

  char str2[] = "lass";
  while (getline(fin, line)) {
    //   cout<<"1 "<<line<<endl;

    // const char *cstr = line.c_str();
    //       if(memcmp(cstr,"/",1)==0)
    //  {
    //        cout<<"2 "<<line<<endl;
    //  }

    // else{

    const char *cstr = line.c_str();
    //   cout<<"2 "<<cstr<<endl;
    char *pc = new char[100];
    strcpy(pc, cstr);
    // cout<<"3 "<<pc<<endl;
    int i;
    for (i = 0; i < strlen(pc); i++) {
      if (pc[i] == ',') {
        int j;
        for (j = i; j < strlen(pc); j++) {
          if ((pc[j] == 'c' || pc[j] == 'C') && pc[j + 1] == 'l' &&
              pc[j + 2] == 'a')
            cout << "get:  " << pc << endl;
        }
      }
      // cout<<"bingo"<<endl;
    }

    //       char *p2= strstr(pc, str2);

    //       cout << p2 << endl;
    //  cout<<line;
    //    std::string line = cstr;

    // }
  }
  fin.close();
  return 0;
}